package main;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

import control.ControlCommand;
import control.TextButton;

public class AboutCanvas extends Canvas{
	protected Font font = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_MEDIUM);
	MainMidlet midlet;
	TextButton button;
	public AboutCanvas(MainMidlet mid) {
		this.midlet = mid;
		setFullScreenMode(true);
		this.button = new TextButton("Ok", 10, 360, 120, 30);
		this.button.setCommand(new ControlCommand() {
			public void Do() {
				midlet.showMenuCanvas();
			}
		});
		
	}
	protected void pointerReleased(int x, int y) {
		button.pointerReleased(x, y);
		repaint();
	}
	protected void pointerPressed(int x, int y) {
		button.pointerPressed(x, y);
		repaint();
	}

	protected void pointerDragged(int x, int y) {
		button.pointerPressed(x, y);
		repaint();
		
	}
	protected void paint(Graphics g) {
		// TODO Auto-generated method stub
		g.setColor(0xff222222);
		g.fillRect(0, 0, 240, 400);
		g.setColor(0xffffffff);
		g.setFont(font);
		g.drawString("Mobile Pixel Art", 120, 30, Graphics.HCENTER|Graphics.TOP);
		g.drawString("Version 1.0.0", 120, 55, Graphics.HCENTER|Graphics.TOP);
		g.drawString("By Do Ba Huy", 120, 80, Graphics.HCENTER|Graphics.TOP);
		button.paint(g);
	}
}
